/**
 * 显示选择设备对话框
 * 
 * @param id
 *            设置值的控件id
 * @param name
 *            显示名称的控件名称
 * 
 */
function selectPicture(id, name) {
	var obj = new Object();
	
	var equi = window.showModalDialog('picture/picture!select', obj,'dialogWidth:750px;dialogHeight:650px');
	if (equi) {
		var ime = equi.split("@");
		$("#" + id).val(ime[0]);
		$("#" + name).attr("src",ime[1]);
	}
	return false;
}
/**
 * 显示选择设备对话框
 * 
 * @param id
 *            设置值的控件id
 * @param name
 *            显示名称的控件名称
 * 
 */
function selectEqui(id, name) {
	var obj = new Object();

	var equi = window.showModalDialog('equipment/equipment!select', obj,
			'dialogWidth:750px;dialogHeight:650px');
	if (equi) {
		var ime = equi.split("@");
		$("#" + id).val(ime[0]);
		$("#" + name).text(ime[1]);
	}
	return false;
}


/**
 * @param idname  like id@name 
 * 
 **/
function selectMe(idname){
	window.returnValue=idname;
	self.close();
}
/**
 * ajax获取部门选择框
 */
function ownerSelector(id) {
	var depts = $("#" + id);
	$.get("admin/department/department!bytype?bean.departmentType=Manufacture",
			function(data) {
				for ( var i = 0; i < data.length; i++) {
					var d = data[i];
					var opt = $("<option></option>");
					opt.val(d['id']);
					opt.text(d['name']);
					depts.append(opt);
				}
			});
}